﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using QLCONGNOLIBS.Securities;

namespace QLCONGNOAPPs.UserControls
{
    public partial class ucPanelControls : RightForms
    {        
        public ucPanelControls(SqlConnection objConnection, SecurityEntity objSecurity)
                    : base(objConnection, objSecurity)
        {
            InitializeComponent();
            this.Dock = DockStyle.Fill;
            m_objConnection = objConnection;
            m_objSecurity = objSecurity;
        }
        
        private void picImage01_Click(object sender, EventArgs e)
        {
            pnlCusControls.Visible = true;
            pnlCusControls.Dock = DockStyle.Fill;
            
            pnlCusControls.Controls.Clear();
            if (m_objConnection.State == ConnectionState.Closed)
            {
                    m_objConnection = (new Commons.Services()).getConnection();
            }
            Customers.ucCustomers frmCus = new Customers.ucCustomers(m_objConnection, m_objSecurity);
            pnlCusControls.Controls.Add(frmCus);
        }
    }
}
